> PHP is_executable() 函数

PHP is_executable() 函数

定义和用法

is_executable() 函数检查指定的文件是否可执行。

语法

is_executable(file)
参数 描述
file 必需。规定要检查的文件。

说明

如果文件存在且可执行,则返回 true。

提示和注释

注释:本函数的结果会被缓存。请使用 clearstatcache() 来清除缓存。

注释:is_executable() 自 PHP 5.0.0 版起可用于 Windows。

例子

<?php
$file = "setup.exe";
if(is_executable($file))
  {
  echo ("$file is executable");
  }
else
  {
  echo ("$file is not executable");
  }
?>

输出:

setup.exe is executable
参考手册

W3c0.com 提供的内容仅用于培训。我们不保证内容的正确性。通过使用本站内容随之而来的风险与本站无关。W3c0 简体中文版的所有内容仅供测试,对任何法律问题及风险不承担任何责任。 当使用本站时,代表您已接受了本站的使用条款和隐私条款。版权所有,保留一切权利。 鲁ICP备15022115号